<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('新增欠还款表')" />
    <th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-qianhuankuanTest-add">
            <div class="form-group">
                <label class="col-sm-3 control-label">仓库：</label>
                <div class="col-sm-8">
                    <select name="cangku" id="cangku" class="form-control"
                            th:with="type=${@cangkuServiceImpl.selectCangkuAll()}" required>
                        <option th:each="lists : ${type}"
                                th:if="${lists.getCangkuName().equals(session.name4user)
                                        || session.QuanXian=='1'||session.QuanXian==1}"
                                th:text="${lists.getCangkuName()}"
                                th:value="${lists.getCangkuName()}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">客户名称：</label>
                <div class="col-sm-7">
                    <input name="kehuName" class="form-control" type="text" th:value="${session.CheckName}">
                </div>

                <!--                             <button class="col-sm-1" onclick="check2historyKehu()">
                                                 历史客户
                                             </button>-->
                <a  class="col-sm-1" href="/qianhuankuan/qianhuankuanTest/addCheck">
                    历史客户
                </a>

                <!--                <script>
                                    function jump(){
                                        $.get("http://localhost:8085/qianhuankuan/qianhuankuanTest/addCheck",function(data,status){
                                            window.location.href(data)
                                        });
                                    }
                                </script>
                                <button class="col-sm-1" onclick="jump()">历史客户</button>-->
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">时间：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <input name="date" class="form-control" placeholder="yyyy-MM-dd" type="text">
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    </div>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">天数：</label>
                <div class="col-sm-8">
                    <input name="tianshu" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">数量：</label>
                <div class="col-sm-8">
                    <input name="shuliang" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">欠还款：</label>
                <div class="col-sm-8">
                    <select name="qianhuan" class="form-control m-b" th:with="type=${@dict.getType('sys_qianhuan')}">
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">金额：</label>
                <div class="col-sm-8">
                    <input name="zongqiankuanjine" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">备注：</label>
                <div class="col-sm-8">
                    <input name="beizhu" class="form-control" type="text">
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <script th:inline="javascript">


        var prefix = ctx + "qianhuankuan/qianhuankuanTest"
        $("#form-qianhuankuanTest-add").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/add", $('#form-qianhuankuanTest-add').serialize());
            }
        }

        function check2historyKehu() {
            document.getElementById("kehuCheck").click()
        }

        $("input[name='date']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });
    </script>
</body>
</html>